A packet relay device is equipped with a plurality of communication ports. Each communication port may serve as an input port as well as an output port. A packet is received via one communication port, transferred in the packet relay device, and transmitted via another communication port. There is a packet relay device that stores a terminal address of a terminal connected to each communication port and selectively transmits a packet via an output port corresponding to a destination address contained in an input packet (for example, see Japanese Laid-open Patent Publication No. 7-95231). Therefore, the packet relay device stores a source address of the input packet in a learning table in association with an input port identifier (ID) that is capable of identifying the input port. This process is referred to as a learning process. There are variations in when to perform the learning process and how to keep the learning table depending on the design of the packet relay device. The variations include: learning right after reception of a packet, learning right before transmission of a packet, learning at the mid-period from reception to transmission of a packet, keeping the learning table for every communication port, sharing the learning table by all of the communication ports, shearing the learning table by a part of the communication ports, and the like.
There is an input packet that is not transmitted via a specified output port and is discarded on the way. Such a packet is referred to as a discard packet. For example, normally, a packet received via a certain communication port is not transmitted via the same communication port. Accordingly, the packet is discarded. However, the learning process on the packet is performed. Accordingly, even a discard packet is transferred to a place in the packet relay device, where the learning process is performed. Thus, the traffic in the packet relay device is increased by the transfer, and the resource of the packet relay device is uselessly used.